var hotDatas = [
	{
	  "pid":"1106744",
	  "img_src":"image/1.jpg",
	  "title":"韩泰轮胎 195/55R15 K407",
	  "car_model":"POLO/福美来/普力马",
	  "price":"359",
	  "tagItems":[
		{
		  "tag":"噪音低"
		},
		{
		  "tag":"很耐磨"
		},
		{
		  "tag":"抓地力强"
		}
	  ]
	},
	{
	  "pid":"1106746",
	  "img_src":"image/2.jpg",
	  "title":"韩泰轮胎 195/55R16 K407",
	  "car_model":"马自达6/速腾/朗逸",
	  "price":"383",
	  "tagItems":[
		{
		  "tag":"噪音低"
		},
		{
		  "tag":"很耐磨"
		},
		{
		  "tag":"抓地力强"
		}
	  ]
	},
	{
	  "pid":"1106747",
	  "img_src":"image/3.jpg",
	  "title":"韩泰轮胎 215/65R16  K415",
	  "car_model":"途胜/逍客/途观",
	  "price":"406",
	  "tagItems":[
		{
		  "tag":"操控所欲"
		},
		{
		  "tag":"舒适随心"
		},
		{
		  "tag":"完美配套"
		}
	  ]
	},
	{
	  "pid":"1106749",
	  "img_src":"image/4.jpg",
	  "title":"韩泰轮胎 195/60R14  K415",
	  "car_model":"索纳塔/大众桑塔纳",
	  "price":"258",
	  "tagItems":[
		{
		  "tag":"操控所欲"
		},
		{
		  "tag":"舒适随心"
		},
		{
		  "tag":"完美配套"
		}
	  ]
	}
  ]

var youDatas = [
	{
	  "pid":"1106745",
	  "img_src":"image/5.jpg",
	  "title":"韩泰轮胎 195/65R15  H426",
	  "price":"341"
	},
	{
	  "pid":"1106748",
	  "img_src":"image/5.jpg",
	  "title":"韩泰轮胎 185/65R15  H426",
	  "price":"316"
	},
	{
	  "pid":"1106750",
	  "img_src":"image/5.jpg",
	  "title":"韩泰轮胎 215/55R17  H426",
	  "price":"616"
	},
	{
	  "pid":"1106831",
	  "img_src":"image/5.jpg",
	  "title":"邓禄普轮胎 195/60R16  SP270",
	  "price":"482"
	},
	{
	  "pid":"1106752",
	  "img_src":"image/5.jpg",
	  "title":"邓禄普轮胎 215/60R16  D8H",
	  "price":"478"
	},
	{
	  "pid":"1106753",
	  "img_src":"image/5.jpg",
	  "title":"邓禄普轮胎 225/65R17  ST30",
	  "price":"562"
	},
	{
	  "pid":"1106755",
	  "img_src":"image/5.jpg",
	  "title":"邓禄普轮胎 195/65R15  SP-R1",
	  "price":"342"
	},
	{
	  "pid":"1106756",
	  "img_src":"image/5.jpg",
	  "title":"邓禄普轮胎 245/55R19  ST30",
	  "price":"924"
	},
	{
	  "pid":"1106757",
	  "img_src":"image/5.jpg",
	  "title":"邓禄普轮胎 205/55R16  SP-R1",
	  "price":"414"
	},
	{
	  "pid":"1106758",
	  "img_src":"image/5.jpg",
	  "title":"固特异轮胎 195/65R15  NCT5",
	  "price":"340"
	},
		  {
	  "pid":"1106759",
	  "img_src":"image/5.jpg",
	  "title":"固特异轮胎 205/55R16  NCT5",
	  "price":"426"
	},
	{
	  "pid":"1106760",
	  "img_src":"image/5.jpg",
	  "title":"固特异轮胎 225/55R17 Assurance",
	  "price":"663"
	},
	{
	  "pid":"1106761",
	  "img_src":"image/5.jpg",
	  "title":"固特异轮胎 235/60R18 EXC",
	  "price":"739"
	},
	{
	  "pid":"1106762",
	  "img_src":"image/5.jpg",
	  "title":"固特异轮胎 225/50R17  NCT5",
	  "price":"670"
	},
	{
	  "pid":"1106763",
	  "img_src":"image/5.jpg",
	  "title":"固特异轮胎 225/55R16  EFF",
	  "price":"650"
	}
  ]

// 2.实例Vue对象
	new Vue({
	    el: '.g-box',
	    data: {
	    	hotData: hotDatas,
	    	youData: youDatas
	    },
	    methods: {
	    	// APP端接口
	    	getApp:function(key,value){
	    		var appData = {"key":key,"value":value};
	    		// alert("key值是:"+key+",vlaue值是:"+value);
	    		//判断访问终端
					var browser={
					    versions:function(){
					        var u = navigator.userAgent, app = navigator.appVersion;
					        return {
					            trident: u.indexOf('Trident') > -1, //IE内核
					            presto: u.indexOf('Presto') > -1, //opera内核
					            webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
					            gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,//火狐内核
					            mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
					            ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
					            android: u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, //android终端
					            iPhone: u.indexOf('iPhone') > -1 , //是否为iPhone或者QQHD浏览器
					            iPad: u.indexOf('iPad') > -1, //是否iPad
					            webApp: u.indexOf('Safari') == -1, //是否web应该程序，没有头部与底部
					            weixin: u.indexOf('MicroMessenger') > -1, //是否微信 （2015-01-22新增）
					            qq: u.match(/\sQQ/i) == " qq" //是否QQ
					        };
					    }(),
					    language:(navigator.browserLanguage || navigator.language).toLowerCase()
					}

				// 判断是安卓还是苹果
				if(browser.versions.android){
					getAppData(JSON.stringify(appData));
				}else{
					var iver = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
					iver = parseInt(iver[1],10);
					// IOS 8以上用webkit方法,IOS 8以下用UIWebview方法
			        if(iver >= 8){
			            // AppModel是OC所注入的对象
    					window.webkit.messageHandlers.AppModel.postMessage({body:appData});
			        }else{
    					getAppData(appData);
			        }
				}
	    	}
	    }
	})